package com.example.hello1.cloud.controller;

import com.example.hello1.cloud.feign.FeignClient2;
import com.example.hello1.cloud.feign.HelloFeignClient;
import com.example.hello1.cloud.feign.MyFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class MovieController {

	@Autowired
	private HelloFeignClient helloFeignClient;

	@Autowired
	private MyFeignClient myFeignClient;

	@Autowired
	private FeignClient2 feignClient2;

	@GetMapping("/say1")
	public String say1() {
		return this.helloFeignClient.hello();
	}

	@GetMapping("/say2")
	public String say2() {
		return this.myFeignClient.hello();
	}

	@GetMapping("/{serviceName}")
	public String findServiceInfoFromEurekaByServiceName(@PathVariable String serviceName) {
		return this.feignClient2.findServiceInfoFromEurekaByServiceName(serviceName);
	}

}
